
var api = require('../lib/brokerApi');
var exception = require('../lib/exception');

exports.getRoom = function *(next) {

    log.http('share houseId: %s', this.params.houseId);
    if(!this.params.houseId) throw exception(exception.RequestError);

    var entity = new api.forShare();
        entity.houseId = this.params.houseId;

    var res = yield entity.call();
    if(100000 == res.code) {
        throw exception(exception.ServerError);
    }

    yield this.render('index', {title: '房源详情', res: res});
};

exports.getFind = function *(next) {
    yield this.render('found');
}